package net.mengkai.activiti7.deployer.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.security.core.GrantedAuthority;

public class SysRole implements GrantedAuthority {

	private String id;
	private String title;
	private String description;
	private boolean isAdmin;
	private boolean isDefault;

    public SysRole(String id) {
        this.id = id;
    }

	public SysRole(String id, String title, boolean isAdmin, boolean isDefault) {
		this.id = id;
		this.title = title;
		this.isAdmin = isAdmin;
		this.isDefault = isDefault;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public boolean isAdmin() {
		return isAdmin;
	}

	public void setAdmin(boolean admin) {
		isAdmin = admin;
	}

	public boolean isDefault() {
		return isDefault;
	}

	public void setDefault(boolean aDefault) {
		isDefault = aDefault;
	}

	@JsonIgnore
	@Override
	public String getAuthority() {
		return "ROLE_ACTIVITI_" + this.title;
	}
}
